package defectsim.resources.deformation;

import javax.vecmath.Vector2d;

import repast.simphony.parameter.Parameters;

import defectsim.SimulationEnvironment;

public class MonotonicStress implements Deformation {

	private SimulationEnvironment environment = SimulationEnvironment.getInstance();
	
	private double stressRate;
	private double stress;
	
	public MonotonicStress(){
		Parameters p = environment.getParameters();
		this.stress = (Double)p.getValue("externalstress");
		this.stressRate = (Double)p.getValue("imposedstressrate");
	}
	
	@Override
	public Vector2d updateExternalStress() {
		stress += stressRate * environment.getTimeStep();
		return new Vector2d(stress, 0.0);
	}

	@Override
	public double getCycle() {
		return 0;
	}

}
